class StoreStaffOvertime < StoreStaffEvent
  #加班
  scope :overtime_hours, -> { where(sort: OVERTIME_HOUR) }
  scope :overtime_amount, -> { where(sort: OVERTIME_AMOUNT) }


  OVERTIME_SORT = EventType::TYPES_ARRAY[:StoreStaffOvertime].invert
  SORT_TYPE = EventType::TYPES_ARRAY[:StoreStaffOvertime]
  OVERTIME_HOUR = OVERTIME_SORT["调休加班"]
  OVERTIME_AMOUNT = OVERTIME_SORT["正常加班"]

  def sort_name
    SORT_TYPE[sort]
  end

  def offable
    self.sort == OVERTIME_HOUR
  end
end
